

CFLAGS	:=	-Wall -O3 -I ../include -fPIC
LDFLAGS	:=	-lutil

ifdef DEBUG
CFLAGS	+=	 -DDEBUG -g
endif

CFILES  :=      $(wildcard *.c) \
		$(wildcard sys/unix/*.c) \
		$(wildcard keytabs/*.c)

OFILES  :=      $(patsubst %.c, %.o, $(CFILES))

TARGET_A  :=	libbetty.a
TARGET_SO :=	libbetty.so


all:	$(TARGET_A) $(TARGET_SO)


$(TARGET_A):	$(OFILES)
		ar rc $@ $+
		ranlib $@

$(TARGET_SO):	$(OFILES)
		$(CC) $(LDFLAGS) --shared -o $@ $+

clean:
		-rm -f $(TARGET_A) $(TARGET_SO)
		-rm -f $(OFILES)


.PHONY:		all clean







